﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Drawing;

using System.Net;
using System.IO;
using System.Text;

public partial class test2 : System.Web.UI.Page
{
    
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.QueryString["DID"] != null)
        {
            int DealID = Convert.ToInt32(Request.QueryString["DID"].ToString());
            SubscribeDeal.HRef = "http://www.zupons.com/Default.aspx?DealID=" + DealID;
            ImageBox.ImageUrl = "http://www.zupons.com/HandlerWSThumb.ashx?url=" + Server.UrlEncode("http://www.zupons.com/Default_Email.aspx?DealID=" + DealID).ToLower().ToString() + "&bw=" + "1000" + "&bh=" + "1200" + "&tw=" + "0" + "&th=" + "0";
        }

       // ImageBox.ImageUrl = "http://localhost:12856/Coupons/HandlerWSThumb.ashx?url=" + Server.UrlEncode("http://localhost:12856/Coupons/Default_Email.aspx?DealID=" + 39).ToLower().ToString() + "&bw=" + "1000" + "&bh=" + "1200" + "&tw=" + "0" + "&th=" + "0";


      // ImageBox.ImageUrl = "http://localhost:1640/Coupons/HandlerWSThumb.ashx?url=" + Server.UrlEncode("http://localhost:1640/Coupons/Default_Email.aspx?cityID=52").ToLower().ToString() + "&bw=" + "1000" + "&bh=" + "1200" + "&tw=" + "0" + "&th=" + "0";


        // Bitmap bmp = ClassWSThumb.GetWebSiteThumbnail("http://www.zupons.com/Default_Email.aspx?cityID=52",Int32.Parse("600"), Int32.Parse("400"), Int32.Parse("0"), Int32.Parse("0"));
        //string s = Server.MapPath("~/Attachment/");
        // bmp.Save(s + "ScreenShot.jpg");
        // Image1.ImageUrl = "http://localhost:1099/Coupons/Attachment/ScreenShot.jpg"; 


    }
    //protected void btnSubmit_Click(object sender, EventArgs e)
    //{



    //    WebRequest objRequest = System.Net.HttpWebRequest.Create("http://localhost:1640/Coupons/Email.aspx");
    //    StreamReader sr = new StreamReader(objRequest.GetResponse().GetResponseStream());
    //    string result = sr.ReadToEnd();
    //    sr.Close();
    //    string html = result;
    //    if (html != null)
    //    {
    //        System.Collections.Specialized.ListDictionary replacements = new System.Collections.Specialized.ListDictionary();
    //        replacements.Add("<%Email%>", "ranjana.lanetteam@yahoo.com");
    //        replacements.Add("<%Deal%>", html);
    //        System.Net.Mail.MailMessage confirmation = Mailer.CreateMessage(new System.Web.UI.Control() as WebControl, Mailer.MessageTemplate.DealSubscribe, replacements, "ranjana.lanetteam@yahoo.com", " This is test mail by ranjana. ");
    //        Mailer.InternalSend(confirmation, false);

    //    }


    //}

}